package com.business.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.business.system.dao.TabRepairWxljMapper;
import com.business.system.pojo.TabRepairWxlj;
import com.business.system.pojo.TabRepairWxljExample;
import com.business.system.service.ITabRapairWXLJService;

@Service
public class TabRepairWXLJServiceImpl implements ITabRapairWXLJService {

	@Autowired
	private TabRepairWxljMapper repairWxljMapper;

	@Override
	public int insert(TabRepairWxlj entity) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxljMapper.insert(entity);
	}

	@Override
	public int update(TabRepairWxlj entity) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxljMapper.updateByPrimaryKey(entity);
	}

	@Override
	public int delete(int id) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxljMapper.deleteByPrimaryKey(id);
	}

	@Override
	public TabRepairWxlj findById(int id) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxljMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<TabRepairWxlj> findList(TabRepairWxlj entity)
			throws RuntimeException {
		// TODO Auto-generated method stub
		TabRepairWxljExample example = new TabRepairWxljExample();
		if (entity.getBelongId() != null && !"".equals(entity.getBelongId())) {
			example.createCriteria().andBelongIdEqualTo(entity.getBelongId());
		}
		return this.repairWxljMapper.selectByExample(example);
	}
}
